//
//  UIView+Frame.swift
//  weiBoOfSwift
//
//  Created by simon on 15/12/13.
//  Copyright © 2015年 simon. All rights reserved.
//

import UIKit

extension UIView{

    var x:CGFloat {
        get{
         return frame.origin.x
        }
        set{
            var frame = self.frame
           frame.origin.x = newValue
            self.frame = frame
      }
    }
    
    var y:CGFloat {
        get{
            return frame.origin.y
        }
        set{
            var frame = self.frame
            frame.origin.y = newValue
            self.frame = frame
        }
    }
    
    var width:CGFloat {
        get{
            return frame.size.width
        }
        set{
            var frame = self.frame
            frame.size.width = newValue
            self.frame = frame
        }
    }
    
    var height:CGFloat {
        get{
            return frame.size.height
        }
        set{
            var frame = self.frame
            frame.size.height = newValue
            self.frame = frame
        }
    }

}
